package com.ruoyi.dynamic.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dynamic.mapper.UserDynamicLikeMapper;
import com.ruoyi.dynamic.domain.UserDynamicLike;
import com.ruoyi.dynamic.service.IUserDynamicLikeService;

/**
 * 动态点赞Service业务层处理
 * 
 * @author DEREK
 * @date 2023-06-19
 */
@Service
public class UserDynamicLikeServiceImpl extends ServiceImpl<UserDynamicLikeMapper, UserDynamicLike> implements IUserDynamicLikeService 
{
    @Autowired
    private UserDynamicLikeMapper userDynamicLikeMapper;

    /**
     * 查询动态点赞
     * 
     * @param id 动态点赞主键
     * @return 动态点赞
     */
    @Override
    public UserDynamicLike selectUserDynamicLikeById(Long id)
    {
        return userDynamicLikeMapper.selectUserDynamicLikeById(id);
    }

    /**
     * 查询动态点赞列表
     * 
     * @param userDynamicLike 动态点赞
     * @return 动态点赞
     */
    @Override
    public List<UserDynamicLike> selectUserDynamicLikeList(UserDynamicLike userDynamicLike)
    {
        return userDynamicLikeMapper.selectUserDynamicLikeList(userDynamicLike);
    }

    /**
     * 新增动态点赞
     * 
     * @param userDynamicLike 动态点赞
     * @return 结果
     */
    @Override
    public int insertUserDynamicLike(UserDynamicLike userDynamicLike)
    {
        userDynamicLike.setCreateTime(DateUtils.getNowDate());
        return userDynamicLikeMapper.insertUserDynamicLike(userDynamicLike);
    }

    /**
     * 修改动态点赞
     * 
     * @param userDynamicLike 动态点赞
     * @return 结果
     */
    @Override
    public int updateUserDynamicLike(UserDynamicLike userDynamicLike)
    {
        userDynamicLike.setUpdateTime(DateUtils.getNowDate());
        return userDynamicLikeMapper.updateUserDynamicLike(userDynamicLike);
    }

    /**
     * 批量删除动态点赞
     * 
     * @param ids 需要删除的动态点赞主键
     * @return 结果
     */
    @Override
    public int deleteUserDynamicLikeByIds(Long[] ids)
    {
        return userDynamicLikeMapper.deleteUserDynamicLikeByIds(ids);
    }

    /**
     * 删除动态点赞信息
     * 
     * @param id 动态点赞主键
     * @return 结果
     */
    @Override
    public int deleteUserDynamicLikeById(Long id)
    {
        return userDynamicLikeMapper.deleteUserDynamicLikeById(id);
    }
}
